package com.yjd.bi.borrow.service;

import com.yjd.comm.base.service.IBaseService;

import java.util.List;
import java.util.Map;

import com.yjd.bi.borrow.model.ArrearsFormModel;
import com.yjd.bi.borrow.model.BorrowCountModel;
import com.yjd.bi.report.enums.TimeType;
import com.yjd.bi.report.model.EChartsModel;

/**
 * <b>description</b>：还款报表业务接口<br>
 * <b>time</b>：2016-06-30 15:13:29 <br>
 * <b>author</b>：  chenpengfei@yijeidai.com
 */
public interface IArrearsFormService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public ArrearsFormModel insert(ArrearsFormModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(ArrearsFormModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception;
	
	/**
	 * 根据时间获取当前待还列表
	 * @param stime
	 * @return
	 * @throws Exception
	 */
	public List<BorrowCountModel> getRecoveryByTime(Long stime) throws Exception;
	
	/**
	 * 获取某个时间段内借款用户数
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public Long getBorrowerCount(Long start,Long end) throws Exception;
	
	/**
	 * 获取统计值
	 * @param field
	 * @param start
	 * @param end
	 * @return
	 */
	public Double fieldSum(String field,Long start,Long end);

	EChartsModel getDates(TimeType timeType, Long timeFrom, String field) throws Exception;

	/**
	 * 90天以上逾期统计
	 * @param field
	 * @param end
	 * @return
	 */
	public Double fieldSelect(String field,Long end,int type);
	
	/**
	 * 待回收金额（含代偿余额）
	 * @param endtime
	 * @return
	 */
	public Double getRecoverPrice(long endtime);
	
	/**
	 * 获取代偿金额或笔数
	 * @param field
	 * @param starttime
	 * @param endtime
	 * @return
	 */
	public Double getSumPrice(String field,long starttime,long endtim,int type);

	/**
	 * 获取预计到期金额
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public Double getExpectPrice(Long startTime, Long endTime,Integer depo_type,Integer dz_type);

}
